import { Global, Module } from '@nestjs/common';
import { UploadService } from './upload.service';
import { UploadController } from './upload.controller';
import { ConfigureService } from '@app/configure';
import { UploaderModule } from '@app/uploader';

@Global()
@Module({
  imports: [
    UploaderModule.forRootAsync({
			inject : [ConfigureService],
			useFactory : async (config:ConfigureService) => {
				return {
					...config.get('upload')
				}
			},
		}),
  ],
  providers: [UploadService],
  controllers: [UploadController],
  exports: [UploadService]
})
export class UploadModule {}
